"""

@name:python学习
@author:yuki
@projectname:起步

"""
import random

with open("ips.txt","w+") as ip:
    for i in range(12000):
        ip.write("172.25.254.{}\n".format(random.randint(0,255)))
with open("ips.txt",mode="r") as ip:
    iplist = ip.read().splitlines()
    ipset = set(iplist)
    ipstatis = dict()
for i in ipset:
    fre = iplist.count(i)
    ipsta = {i:fre}
    ipstatis.update(ipsta)
order=sorted(ipstatis.items(),key=lambda x:x[1],reverse=True)
for i in range(0,10):
    print("The{0} is ip {1} time is {2}".format(i+1,order[i][0],order[i][1]))